using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class AdjHeaderMap : EntityTypeConfiguration<AdjHeader>
    {
        public AdjHeaderMap()
        {
            // Primary Key
            this.HasKey(t => t.ID);

            // Properties
            this.Property(t => t.ID)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.Date)
                .IsFixedLength()
                .HasMaxLength(10);

            this.Property(t => t.Number)
                .HasMaxLength(20);

            // Table & Column Mappings
            this.ToTable("AdjHeader");
            this.Property(t => t.ID).HasColumnName("ID");
            this.Property(t => t.Date).HasColumnName("Date");
            this.Property(t => t.CreatedBY).HasColumnName("CreatedBY");
            this.Property(t => t.Location).HasColumnName("Location");
            this.Property(t => t.Number).HasColumnName("Number");
            this.Property(t => t.DocDate).HasColumnName("DocDate");
        }
    }
}
